<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>系统管理</title>
<link href="${cdnctx}/dep/jquery/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
<%@ include file="/common/util.jsp"%>
<script type="text/javascript">
var aircodes = [];
//灯具的自动填充
var aircodes = eval('${deviceAirInfo }');

function lightAutoComplete(){
  $("input[name='aircode']").autocomplete({
    source: aircodes,
    minLength: 0
  });
  //点击灯具输入框则自动弹出列表
  $("input[name='aircode']").focus(function() {
    $(this).autocomplete('search');
  });
}
$(document).ready(function() {
//灯具自动完成
  lightAutoComplete();
  $("#PointAirEditForm").validate({
		rules: {
			'aircode': {
				required: true 
			},
			'airnum': {
				required: true,
			 	digits:true
			}
		},
		messages: {
			'aircode': {
				required: "空调番号"
			},
			'airnum': {
				required: "空调数量",
              digits: "请输入合法的数量格式"
			}
		},
		submitHandler: function(form) {   //提交前的处理
		var code=$("input[name='aircode']").val();
		if(aircodes.indexOf(code)>=0){
		form.submit();
	}else{
			$("#error").text('请输入正确的空调番号');
		}
		}
	});

});

	
</script>
</head>
<body class="main">
	<div class="-frame -style -luster" id="css_container">
		<!--首页框架页眉部分↓-->
		<%@ include file="/WEB-INF/pages/inc/header.jsp"%>
		<!--首页框架页眉部分↑-->

		<div class="content">

			<!-- Left导航菜单◎开始 -->
			<%@ include file="/WEB-INF/pages/inc/leftmenu.jsp"%>
			<!-- Left导航菜单◎结束 -->

			<div class="main-mid">
              <div class="pos"><img src="${cdnctx}/src/index/img/index.png">
				<a href="<%--${cdnctx}/system/systemMenu.shtml--%>">系统管理  </a>>
				<a href="${cdnctx}/system/customerinfo/customerMain.shtml">公司信息管理</a>>
				<a href="${cdnctx}/systemCustomerArea/customerAreaList.shtml?customerinfoid=${customerArea.customerinfoid }">${customerArea.companyname }</a>>
				<a href="${cdnctx}/systemAreaPoint/areaPointList.shtml?areaid=${customerArea.id }&customerinfoid=${customerArea.customerinfoid }" >${customerArea.areaname }</a>>
				<a href="${cdnctx }/systemPointAir/pointAirList.shtml?pointid=${areaPoint.id}">${areaPoint.pointname }</a>
				><a><c:if test="${empty pointAir.id }">添加</c:if><c:if test="${not empty pointAir.id }">编辑</c:if>空调设备</a>
				</div>				
				<div class="css_contentDiv">
					<div class="searchDetailed">
					<form id="PointAirEditForm" method="post" action="${cdnctx}/systemPointAir/savePointAir.shtml">
						  <input type="hidden"  name="id" id="id" value="${pointAir.id }"/>
						  <input type="hidden"  name="pointid" id="pointid" value="${areaPoint.id }"></input>
						  <input type="hidden"  name="areaid" id="areaid" value="${customerArea.id }"/>
						  <input type="hidden"  name="customerinfoid" id="customerinfoid" value="${customerArea.customerinfoid }"/>
						  <table align="center" id="table" width="800" border="0" cellspacing="0" cellpadding="0">
             		<tbody class="ligthTr">
                      <tr>
                          <td class="mainText"><label class="formlabel"><font color="red">*</font>空调番号：</label></td>
                          <td>
                              <input type="hidden"  name="airid" id="airid" value="${pointAir.airid }"/>
                              <input type="text" name="aircode"  id="aircode" value="${pointAir.aircode }" class="form_input large"  >
                              <font color="red">*</font>数量：<input class="form_input" name="airnum" id="airnum" value="${pointAir.airnum }" type="text" style="width:50px"/>&nbsp;
                          <font  id="error" color="red"></font >
                          </td>
                       </tr>
                     </tbody>

                     <tr>
             				  <td></td>
						          <td>
				                <input type="submit" class="form_save" value="保&nbsp;存"/>
						            <input type="reset" class="form_cancle" value="取&nbsp;消"/>
				              </td>
             				</tr>
             			</table>
              		</form>
              		</div>
				</div>
			</div>

		</div>

		<!--首页框架页尾部分↓-->
		<%@ include file="/WEB-INF/pages/inc/footer.jsp"%>
		<!--首页框架页尾部分↑-->
	</div>
</body>
</html>